 package cn.exrick.xboot.modules.assessment.dao;

 import cn.exrick.xboot.base.XbootBaseDao;
 import cn.exrick.xboot.modules.assessment.entity.HkFormIndex;
 import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;

 import java.util.List;


 /**
  * 表单项数据处理层
  * @author yck
  */
 public interface HkFormIndexDao extends XbootBaseDao<HkFormIndex, String> {

  @Modifying
  @Query("update HkFormIndex sc set sc.isCustomeDelete ='2' ")
  public void setCustomDeleteFormIndex();

  @Modifying
  @Query("update HkFormIndex sc set sc.isCustomeAdd ='2' ")
  void setCustomAddFormIndex();

  @Query(value = "SELECT * FROM hk_form_index WHERE IF(?1 !='', form_index_name like %?1%, 1=1) and is_custome_add != 1 and is_custome_delete != 1",nativeQuery=true)
  List<HkFormIndex> getAll(String formIndexName);
 }